package com.itmck.feign;

import com.itmck.dto.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 太阳当空照,花儿对我笑
 * <p>
 * Create by M ChangKe 2021/11/2 20:54
 * <p>
 * 注意事项:
 * 1:Feign 里面定义的接口，有多个@RequestParam，但只能有不超过一个@RequestBody
 * 2:@FeignClient指定configuration后FeignConfig不能添加@Configuration
 **/
@FeignClient(value = "springcloud-product")
public interface ProductFeignClient {


    @ResponseBody
    @GetMapping("/product/getProduct")
    String getProduct(@RequestParam("name") String name);

    @ResponseBody
    @PostMapping("/product/getProductUser")
    User getProductUser(@RequestBody User user);

}